<%--
  Created by IntelliJ IDEA.
  User: lee
  Date: 16-10-24
  Time: 下午11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>馆藏检索</title>
    <script src="<%=request.getContextPath()%>/js/angular-1.0.8/angular.js"></script>
    <script src="js/angular-1.0.8/angular-route.min.js"></script>
    <script type="text/javascript">

        function bookController($scope, $http) {
            $scope.val = "";
            $scope.result = "";
            $scope.selType = "0";

            $scope.find = function () {
                $http({
                    method: "post",
                    url: '<%=request.getContextPath()%>/book/find.do',
                    params: {"val": $scope.val, "result": $scope.result, "selType": $scope.selType}
                }).success(function (data, status, headers, config) {
                    $scope.result = data;
                }).error(function (data, status, headers, config) {
                    alert("error" + data);
                })
            }

        }
    </script>
</head>
<body ng-app>

<div ng-controller="bookController">


    <label for="selType">检索方式：</label>
    <select id="selType" name="selType" ng-model="selType">
        <option value="0">书名</option>
        <option value="1">isbn</option>
        <option value="2">出版社</option>
        <option value="3">作者</option>
    </select>
    <input type="text" name="val" ng-model="val">
    <button type="button" ng-click="find()">检索</button>
    <br>
    <textarea name="result" ng-model="result" id="result" cols="70" rows="20">

</textarea>

</div>

</body>
</html>
